PSCB(current, iim) = iim;
vector = IA64_SPECULATION_VECTOR;
break;
+ case 29:
+ vector = IA64_DEBUG_VECTOR;
+ if (debugger_trap_entry(vector,regs))
+ return;
+ break;
case 30:
// FIXME: Should we handle unaligned refs in Xen??
vector = IA64_UNALIGNED_REF_VECTOR;
vector = IA64_LOWERPRIV_TRANSFER_TRAP_VECTOR;
break;
case 35:
- printk("ia64_handle_reflection: handling taken branch trap\n");
vector = IA64_TAKEN_BRANCH_TRAP_VECTOR;
+ if (debugger_trap_entry(vector,regs))
+ return;
break;
case 36:
- printk("ia64_handle_reflection: handling single step trap\n");
vector = IA64_SINGLE_STEP_TRAP_VECTOR;
+ if (debugger_trap_entry(vector,regs))
+ return;
break;
default:
- printk("ia64_handle_reflection: unhandled vector=0x%lx\n",
- vector);
- while (vector)
- /* spin */;
+ panic_domain(regs, "ia64_handle_reflection: "
+ "unhandled vector=0x%lx\n", vector);
return;
}
if (check_lazy_cover && (isr & IA64_ISR_IR) &&
#ifdef CRASH_DEBUG
// crash_debug=y
-/* The main trap handlers use these helper macros which include early bail. */
-static inline int debugger_trap_entry(
- unsigned int vector, struct cpu_user_regs *regs)
-{
- return 0;
-}
-
extern int __trap_to_cdb(struct cpu_user_regs *r);
static inline int debugger_trap_fatal(
unsigned int vector, struct cpu_user_regs *regs)
#define smp_send_stop() /* nothing */
#endif
-#elif defined DOMU_DEBUG
-// domu_debug=y
-#warning "domu_debug is not implemented yet."
-/* The main trap handlers use these helper macros which include early bail. */
-static inline int debugger_trap_entry(
- unsigned int vector, struct cpu_user_regs *regs)
-{
- return 0;
-}
-
+#else
static inline int debugger_trap_fatal(
unsigned int vector, struct cpu_user_regs *regs)
{
}
#define debugger_trap_immediate() ((void)0)
-#else
-/* The main trap handlers use these helper macros which include early bail. */
+#endif
+
static inline int debugger_trap_entry(
unsigned int vector, struct cpu_user_regs *regs)
{
- return 0;
-}
+ struct vcpu *v = current;
+
+ if (guest_kernel_mode(regs) && v->domain->debugger_attached) {
+ domain_pause_for_debugger();
+ return 1;
+ }
-static inline int debugger_trap_fatal(
- unsigned int vector, struct cpu_user_regs *regs)
-{
return 0;
}
-#define debugger_trap_immediate() ((void)0)
-#endif
#endif // __ASSEMBLLY__
#endif /* __ASM_DEBUGGER_H__ */